package com.li.serialize;


import com.li.utils.enums.SerializationTypeEnum;

public class SerializerBuilder {
    public static Serializer getInstance(byte codec){
        String className = SerializationTypeEnum.getClassName(codec);
        if (className!=null){
            try {
                Class<?> forName = Class.forName(className);
                Serializer serializer = (Serializer) forName.newInstance();
                return serializer;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}
